<!--混凝土拌和站---动态监控--实时监控-->
<!--
 * @Author: 卡卡 1071780426@qq.com
 * @Date: 2022-12-02 13:13:25
 * @LastEditors: 卡卡 1071780426@qq.com
 * @LastEditTime: 2023-10-31 16:51:24
 * @FilePath: \backstage - 副本\src\views\aa.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="department" id="department">
    <!-- 右侧 -->
    <div class="department_right">
      <div class="app-container-btn">
        <el-button
          type="primary"
          v-if="btnShow"
          @click="yj_saveForm('formData')"
          >保存</el-button
        >

        <el-button @click="goBack">返回</el-button>
      </div>
      <!-- 表格 -->
      <div class="text_table TensionRealTime">
        <div class="dialogBody common table_detail" style="overflow: hidden">
          <div style="overflow-y: auto; margin-bottom: 20px">
            <div class="app-container-area-title">
              <span class="app-container-area-title-divider"></span>
              <span>基本信息</span>
            </div>
            <div>
              <publicForm
                ref="publicForm"
                lableWidth="95px"
                :formObj="formObj"
                :formData="formData"
              >
              </publicForm>
            </div>
            <div class="app-container-area-title">
              <span class="app-container-area-title-divider"></span>
              <span>材料用量</span>
            </div>
            <div style="margin-top: 8px" class="levelClass materialClass">
              <tableData
                :config="material_config"
                :dataList="materialData"
                statusType="3"
                :level="level"
                :earlyWarning="earlyWarning"
                :currentRow="false"
                :stripe="false"
              />
            </div>
            <div class="app-container-area-title">
              <span class="app-container-area-title-divider"></span>
              <span>处理情况</span>
            </div>

            <el-collapse v-model="activeNames" @change="changeCollapse">
              <el-collapse-item name="0" v-if="handNum">
                <!-- <el-collapse-item name="0"> -->
                <template slot="title">
                  <div>
                    <img
                      style="vertical-align: middle"
                      src="@/assets/img/Supervision/com_flg.png"
                      alt=""
                    />
                    <span style="margin-left: 8px">闭合申请单</span>
                  </div>
                </template>
                <div style="height: 160px; margin-top: 3px">
                  <publicForm
                    ref="publicForm0"
                    lableWidth="95px"
                    :formObj="handleObj"
                    :formData="handleData"
                    :timestamp="handleData.fHandlefile"
                    :fileList="fSourcefileList"
                    @delteFile="delteFile"
                  >
                  </publicForm>
                </div>
              </el-collapse-item>

              <el-collapse-item name="1" v-if="firstNum">
                <!-- <el-collapse-item name="1"> -->
                <template slot="title">
                  <div>
                    <img
                      style="vertical-align: middle"
                      src="@/assets/img/Supervision/com_flg.png"
                      alt=""
                    />
                    <span style="margin-left: 8px">一级审核</span>
                  </div>
                </template>
                <div style="height: 70px; margin-top: 3px">
                  <publicForm
                    ref="publicForm1"
                    lableWidth="95px"
                    :formObj="processObj"
                    :formData="handleData"
                  >
                  </publicForm>
                </div>
              </el-collapse-item>
              <el-collapse-item name="2" v-if="secondNum">
                <!-- <el-collapse-item name="2"> -->
                <template slot="title">
                  <div>
                    <img
                      style="vertical-align: middle"
                      src="@/assets/img/Supervision/com_flg.png"
                      alt=""
                    />
                    <span style="margin-left: 8px">二级审核</span>
                  </div>
                </template>
                <div style="height: 70px; margin-top: 3px">
                  <publicForm
                    ref="publicForm2"
                    lableWidth="95px"
                    :formObj="examineObjs"
                    :formData="handleData"
                  >
                  </publicForm>
                </div>
              </el-collapse-item>
            </el-collapse>
            <div style="height: 50px"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import TableData from "@/components/waterManage/public/el-tables"; //主页面列表
import Pagination from "@/components/public/el-pagination"; //主页面分页
import publicForm from "@/components/public/el-form.vue"; //弹框form
import actions from "@/actions";

import formJs from "./regexDetail.js"; //新增弹框配置项
import {
  getUserCompanyTreeList, //左侧机构树接口
  getWaterClosedLists, //主页面列表接口
  getWaterClosedFormByParentId, //主页面列表详情接口
  getStationmachineByfMachineid, //骨料
  getStationmachineList, //拌合站列表
  addWaterClosedForm, //闭合保存
  getMachineListByStationId, //拌合机
  getUserNature,
} from "@/api/request.js";
import { statusTypes } from "@/utils/config"; //配置项
export default {
  name: "waterSuperRecordDetail",
  data() {
    return {
      name: "waterSuperRecordDetail", //按钮配置页面代号
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
      },
      timeDuring: [], //主页面日期筛选绑定值

      rowInfo: null, //当前行信息
      projectsObj: [], //项目名
      tendersObj: [],
      falgId: null,
      editLoading: false,
      sgcDataList: formJs.sgcDataList, //施工层位
      yjDataList: formJs.yjDataList, //预警级别
      formData: {}, //新增编辑向后台传递对象
      navigatepageNums: null, //是否显示分页
      queryCriteriaData: {}, //分页
      sgbwList: formJs.sgbwList, //顶部下拉框---施工部位
      djDataList: formJs.djDataList,
      CloseoperationDataList: formJs.CloseoperationDataList,
      bhzDataList: [], //拌合站
      bhjDataList: [], //拌合机
      value2: "", //主页面日期筛选绑定值
      // 列表配置项
      table_config: formJs.cbtable_config,
      tableData: [], //表格列表数据列表
      highlightBd: true, //左侧机构树停留背景色
      treelength: false, //左侧树显示隐藏
      showName: "未选择公司",
      fId: null, //点击当前列表数据fId
      listLoading: false, //列表数据加载loading
      loadingEditDialog: false, //弹框loading
      userInfo: {}, //登录用户
      // 弹框
      handleObj: formJs.handleObjs, //新增编辑配置参数
      materialData: [], //材料用量列表
      level: [], //强度等级
      earlyWarning: [], //预警标准
      handleObjs1: formJs.handleObjs1,
      processObj: formJs.processObjs, //一级审核
      processObj1: formJs.processObjs1, //一级审核
      examineObjs: formJs.examineObjs, //二级审核
      examineObjs1: formJs.examineObjs1, //二级审核
      formObj: formJs.formObj, //新增编辑配置参数
      btnShow: true, //保存按钮是否显示
      handNum: false, //闭合申请单
      firstNum: false, //一级审核
      secondNum: false, //二级审核
      fSourcefileList: [],
      dialogTitle: "",
      activeNames: ["0"],
      handleData: {
        fId: "", // 申请单fid //为空判断为新增
        fCompanyid: "", // 施工标段id
        aduitStatus: "", // 保存状态
        fParentid: "", // 对应的超标记录fid
        fWarningcontent: "", // 预警内容
        fReason: "", // 问题原因
        fHandleway: "", // 处理方式
        fHandleresult: "", // 处理结果
        fHandledate: 1672977125260,
        fHandledates: "", // 处理日期
        fHandleusername: "", // 处理人名称
        fHandlefile: "", // 附件
        fFirstcheckresult: "", // 一级审核处理结果
        fFirstcheckopinion: "", // 一级审核处理意见
        fFirstcheckusername: "", // 一级审核处理人name
        fFirstcheckdates: "", // 一级审核处理日期
        fSecondcheckresult: "", // 二级审核处理结果
        fSecondcheckopinion: "", // 二级审核处理意见
        fSecondcheckusername: "", // 二级审核处理人name
        fSecondcheckdates: "", // 二级审核处理日期
        userId: "", // 当前登录人id
        userName: "", // 当前登录人姓名
        recordfiles: [], // 删除文件id集合
      },
      material_config: formJs.material_config,
      // 弹框
    };
  },
  components: {
    TableData, //主页面列表
    Pagination, //分页
    publicForm,
  },
  mounted() {
    actions.onGlobalStateChange((state, prev) => {
      this.userInfo = prev.currentUser;
      getUserNature({
        username: this.userInfo.loginName,
      })
        .then((res) => {
          if (res.errcode) {
            this.userInfo.companyNature = res.data.Nature;
            this.yj_viewForm(
              JSON.parse(this.$route.query.data),
              this.userInfo.companyNature
            );
          } else {
            this.$message.error("获取当前用户机构性质", res.msg);
          }
        })
        .catch((err) => {
          this.$message.error("获取当前用户机构性质接口报错", err.msg);
          console.log("当前用户机构性质err", err);
        });
      this.token = prev.token;
      var data = prev.currentUser.projects;
      this.projectsObj = [
        {
          fItemName: "所有项目",
          fItemValue: "",
        },
      ];
      data.map((item) => {
        this.projectsObj.push({
          fItemName: item.projectName,
          fItemValue: item.projectId,
        });
      });
    }, true);
  },
  methods: {
    goBack() {
      this.$router.back();
    },
    getGlName(data) {
      getStationmachineByfMachineid({ machineId: data })
        .then((res1) => {
          if (res1.errcode == 0) {
            this.material_config.thead[3].label =
              res1.data.yjQmpMsStationmachine.fParm1;
            this.material_config.thead[4].label =
              res1.data.yjQmpMsStationmachine.fParm2;
            this.material_config.thead[5].label =
              res1.data.yjQmpMsStationmachine.fParm3;
            this.material_config.thead[6].label =
              res1.data.yjQmpMsStationmachine.fParm4;
            this.material_config.thead[7].label =
              res1.data.yjQmpMsStationmachine.fParm5;
            this.material_config.thead[8].label =
              res1.data.yjQmpMsStationmachine.fParm6;
          } else {
            this.$message.error("获取骨料名", res1.msg);
          }
        })
        .catch((error) => {
          console.log("获取骨料名接口报错", error.msg);
        });
    },
    // 查看
    yj_viewForm(row, companyNature) {
      console.log("row", row);

      this.btnShow = true; //显示保存按钮，当查看时隐藏
      this.handleObj = formJs.handleObjs; //新增编辑配置参数
      this.processObj = formJs.processObjs; //二级审核
      this.examineObjs = formJs.examineObjs; //三级审核
      this.checkStatus = row.fCheckstatus; //闭合状态
      this.handleData.aduitStatus = row.fCheckstatus; //闭合状态
      var time = new Date();
      const y = time.getFullYear();
      const m = (time.getMonth() + 1 + "").padStart(2, "0");
      const d = (time.getDate() + "").padStart(2, "0");
      this.dialogTitle = "编辑";
      console.log(companyNature, row.fCheckstatus, row.fCloseoperation);
      if (
        companyNature == "施工单位" &&
        row.fCheckstatus == 0 &&
        row.fCloseoperation == "未闭合"
      ) {
        this.handNum = true; //申请单显示
        this.firstNum = false; //一级审核显示
        this.secondNum = false; //二级审核显示
        this.activeNames = ["0"]; //默认展开折叠面板
        this.handleObj = this.handleObjs1;
        this.handleData = {
          fId: "", // 申请单fid //为空判断为新增
          fCompanyid: this.getList.fCompanyid, // 施工标段id
          aduitStatus: row.fCheckstatus, // 保存状态
          fParentid: "", // 对应的超标记录fid
          fWarningcontent: "", // 预警内容
          fReason: "", // 问题原因
          fHandleway: "", // 处理方式
          fHandleresult: "", // 处理结果
          fHandledate: "",
          fHandledates: "", // 处理日期
          fHandleusername: "", // 处理人名称
          fHandlefile: "", // 附件
          fFirstcheckresult: "", // 一级审核处理结果
          fFirstcheckopinion: "", // 一级审核处理意见
          fFirstcheckusername: "", // 一级审核处理人name
          fFirstcheckdates: "", // 一级审核处理日期
          fSecondcheckresult: "", // 二级审核处理结果
          fSecondcheckopinion: "", // 二级审核处理意见
          fSecondcheckusername: "", // 二级审核处理人name
          fSecondcheckdates: "", // 二级审核处理日期
          userId: this.userInfo.id, // 当前登录人id
          userName: this.userInfo.userName, // 当前登录人姓名
          recordfiles: [], // 删除文件id集合
        };
        this.fSourcefileList = [];
        this.handleData.fHandledates = `${y}-${m}-${d}`; // 处理日期
      } else if (
        companyNature == "总监办" &&
        row.fCheckstatus == 1 &&
        row.fCloseoperation == "未闭合"
      ) {
        console.log("总监办222");
        this.handNum = true; //申请单显示
        this.firstNum = true; //一级审核显示
        this.secondNum = false; //二级审核显示
        this.activeNames = ["1"]; //默认展开折叠面板
        this.handleObj.map((item) => {
          //闭合单
          item.disabled = true; //闭合单禁用
          item.uploadSelect = false; //上传附件按钮是否显示
          item.rules = []; //必填项不必填
        });
        this.processObj = this.processObj1;
        this.handleData = {
          fId: "", // 申请单fid //为空判断为新增
          fCompanyid: this.getList.fCompanyid, // 施工标段id
          aduitStatus: row.fCheckstatus, // 保存状态
          fParentid: "", // 对应的超标记录fid
          fWarningcontent: "", // 预警内容
          fReason: "", // 问题原因
          fHandleway: "", // 处理方式
          fHandleresult: "", // 处理结果
          fHandledate: "",
          fHandledates: "", // 处理日期
          fHandleusername: "", // 处理人名称
          fHandlefile: "", // 附件
          fFirstcheckresult: "", // 一级审核处理结果
          fFirstcheckopinion: "", // 一级审核处理意见
          fFirstcheckusername: "", // 一级审核处理人name
          fFirstcheckdates: "", // 一级审核处理日期
          fSecondcheckresult: "", // 二级审核处理结果
          fSecondcheckopinion: "", // 二级审核处理意见
          fSecondcheckusername: "", // 二级审核处理人name
          fSecondcheckdates: "", // 二级审核处理日期
          userId: this.userInfo.id, // 当前登录人id
          userName: this.userInfo.userName, // 当前登录人姓名
          recordfiles: [], // 删除文件id集合
        };

        this.handleData.fFirstcheckdates = `${y}-${m}-${d}`; //一级审核处理日期
      } else if (
        companyNature == "建设单位" &&
        row.fCheckstatus == 2 &&
        row.fCloseoperation == "未闭合"
      ) {
        this.handNum = true;
        this.firstNum = true;
        this.secondNum = true;
        this.activeNames = ["2"]; //默认展开折叠面板
        this.handleObj.map((item) => {
          //闭合单
          item.disabled = true; //闭合单禁用
          item.uploadSelect = false; //上传附件按钮是否显示
          item.rules = []; //必填项不必填
        });
        this.processObj.map((item) => {
          //一级审核
          item.disabled = true; //一级审核表单禁用
          item.rules = []; //必填项不必填
        });
        this.examineObjs = this.examineObjs1;
        this.handleData = {
          fId: "", // 申请单fid //为空判断为新增
          fCompanyid: this.getList.fCompanyid, // 施工标段id
          aduitStatus: row.fCheckstatus, // 保存状态
          fParentid: "", // 对应的超标记录fid
          fWarningcontent: "", // 预警内容
          fReason: "", // 问题原因
          fHandleway: "", // 处理方式
          fHandleresult: "", // 处理结果
          fHandledate: "",
          fHandledates: "", // 处理日期
          fHandleusername: "", // 处理人名称
          fHandlefile: "", // 附件
          fFirstcheckresult: "", // 一级审核处理结果
          fFirstcheckopinion: "", // 一级审核处理意见
          fFirstcheckusername: "", // 一级审核处理人name
          fFirstcheckdates: "", // 一级审核处理日期
          fSecondcheckresult: "", // 二级审核处理结果
          fSecondcheckopinion: "", // 二级审核处理意见
          fSecondcheckusername: "", // 二级审核处理人name
          fSecondcheckdates: "", // 二级审核处理日期
          userId: this.userInfo.id, // 当前登录人id
          userName: this.userInfo.userName, // 当前登录人姓名
          recordfiles: [], // 删除文件id集合
        };
        this.handleData.fSecondcheckdates = `${y}-${m}-${d}`; //二级审核处理日期
      } else {
        console.log(2222);
        //查看页面
        this.dialogTitle = "查看";
        this.btnShow = false;
        if (row.fCheckstatus == 0) {
          console.log(333);
          this.handNum = false; //闭合申请单显示
          this.firstNum = false; //一级审核显示
          this.secondNum = false; //二级审核显示
        } else if (row.fCheckstatus == 1) {
          this.handNum = true; //闭合申请单显示
          this.firstNum = false; //一级审核显示
          this.secondNum = false; //二级审核显示

          this.activeNames = ["0"]; //默认展开折叠面板
          this.handleObj.map((item) => {
            //闭合单
            item.disabled = true; //闭合单禁用
            item.uploadSelect = false; //上传附件按钮是否显示
            item.rules = []; //必填项不必填
          });
        } else if (row.fCheckstatus == 2) {
          this.handNum = true; //闭合申请单显示
          this.firstNum = true; //一级审核显示
          this.secondNum = false; //二级审核显示
          this.activeNames = ["0", "1"]; //默认展开折叠面板
          this.handleObj.map((item) => {
            //闭合单
            item.disabled = true; //闭合单禁用
            item.uploadSelect = false; //上传附件按钮是否显示
            item.rules = []; //必填项不必填
          });
          this.processObj.map((item) => {
            //一级审核
            item.disabled = true; //一级审核表单禁用
            item.rules = []; //必填项不必填
          });
        } else if (row.fCheckstatus == 3) {
          this.handNum = true; //闭合申请单显示
          this.firstNum = true; //一级审核显示
          this.secondNum = true; //二级审核显示
          this.activeNames = ["0", "1", "2"]; //默认展开折叠面板
          this.handleObj.map((item) => {
            //闭合单
            item.disabled = true; //闭合单禁用
            item.uploadSelect = false; //上传附件按钮是否显示
            item.rules = []; //必填项不必填
          });
          this.processObj.map((item) => {
            //一级审核
            item.disabled = true; //一级审核表单禁用
            item.rules = []; //必填项不必填
          });
          this.examineObjs.map((item) => {
            item.disabled = true; //二级审核表单禁用
            item.rules = []; //必填项不必填
          });
        }
      }

      this.fPhotofilelist = [];
      if (row.fId != "" && row.fId != null) {
        this.fId = row.fId;
        this.loadingEditDialog = true;
        getWaterClosedFormByParentId({
          fId: this.fId,
          fCompanyid: row.fCompanyid,
        }).then((res) => {
          if (res.errcode == 0) {
            var that = this;
            that.loadingEditDialog = false;

            that.formData = res.data.dischargeinfo; //基本信息及材料用量
            that.getGlName(res.data.dischargeinfo.fMachineid);
            var totalData = res.data.closeinfo; //闭合申请单、一级、二级审核

            this.handleData.fParentid = this.fId; //对应的超标记录fid

            if (this.checkStatus == 0) {
              this.handleData.fId = totalData.fId; //申请单fid //为空判断为新增
              this.handleData.fWarningcontent = totalData.fWarningcontent; // 预警内容
              this.handleData.fHandlefile = totalData.fHandlefile; //处理附件id
              this.handleData.fCompanyid = totalData.fCompanyid; // 施工标段id
            } else if (this.checkStatus == 1) {
              this.handleData.fId = totalData.fId; //申请单fid //为空判断为新增
              this.handleData.fCompanyid = totalData.fCompanyid; // 施工标段id
              this.handleData.fWarningcontent = totalData.fWarningcontent; // 预警内容
              this.handleData.fHandlefile = totalData.fHandlefile; //处理附件id

              this.handleData.fReason = totalData.fReason; // 问题原因
              this.handleData.fHandleresult = totalData.fHandleresult; // 处理结果
              this.handleData.fHandledates = totalData.fHandledates; //处理日期
              this.handleData.fHandleusername = totalData.fHandleusername; // 处理人名称
              this.fSourcefileList = res.data.fSourcefileList; // 附件
              this.handleData.fHandleway = totalData.fHandleway; // 处理方式
            } else if (this.checkStatus == 2) {
              this.handleData.fId = totalData.fId; //申请单fid //为空判断为新增
              this.handleData.fCompanyid = totalData.fCompanyid; // 施工标段id
              this.handleData.fWarningcontent = totalData.fWarningcontent; // 预警内容
              this.handleData.fHandlefile = totalData.fHandlefile; //处理附件id

              this.handleData.fReason = totalData.fReason; // 问题原因
              this.handleData.fHandleresult = totalData.fHandleresult; // 处理结果
              this.handleData.fHandledates = totalData.fHandledates; //处理日期
              this.handleData.fHandleusername = totalData.fHandleusername; // 处理人名称
              this.fSourcefileList = res.data.fSourcefileList; // 附件
              this.handleData.fHandleway = totalData.fHandleway; // 处理方式

              this.handleData.fFirstcheckresult = totalData.fFirstcheckresult; // 一级审核处理结果
              this.handleData.fFirstcheckopinion = totalData.fFirstcheckopinion; // 一级审核处理意见
              this.handleData.fFirstcheckusername =
                totalData.fFirstcheckusername; //一级审核处理人name
              this.handleData.fFirstcheckdates = totalData.fFirstcheckdates; //一级审核处理日期
            } else if (this.checkStatus == 3) {
              this.handleData.fId = totalData.fId; //申请单fid //为空判断为新增
              this.handleData.fCompanyid = totalData.fCompanyid; // 施工标段id
              this.handleData.fWarningcontent = totalData.fWarningcontent; // 预警内容
              this.handleData.fReason = totalData.fReason; // 问题原因

              this.handleData.fHandleresult = totalData.fHandleresult; // 处理结果
              this.handleData.fHandledates = totalData.fHandledates; //处理日期
              this.handleData.fHandleusername = totalData.fHandleusername; // 处理人名称
              this.fSourcefileList = res.data.fSourcefileList; // 附件
              this.handleData.fHandlefile = totalData.fHandlefile; //处理附件id
              this.handleData.fHandleway = totalData.fHandleway; // 处理方式

              this.handleData.fFirstcheckresult = totalData.fFirstcheckresult; // 一级审核处理结果
              this.handleData.fFirstcheckopinion = totalData.fFirstcheckopinion; // 一级审核处理意见
              this.handleData.fFirstcheckusername =
                totalData.fFirstcheckusername; //一级审核处理人name
              this.handleData.fFirstcheckdates = totalData.fFirstcheckdates; //一级审核处理日期

              this.handleData.fSecondcheckresult = totalData.fSecondcheckresult; // 二级审核处理结果
              this.handleData.fSecondcheckopinion =
                totalData.fSecondcheckopinion; // 二级审核处理意见
              this.handleData.fSecondcheckusername =
                totalData.fSecondcheckusername; //二级审核处理人name
              this.handleData.fSecondcheckdates = totalData.fSecondcheckdates; //二级审核处理日期
            }

            this.materialData = [
              {
                name: "实际称量值(t)",
                cement1: res.data.dischargeinfo.fCement1actualweighingvalue,
                cement2: res.data.dischargeinfo.fCement2actualweighingvalue,
                aggregate1:
                  res.data.dischargeinfo.fAggregate1actualweighingvalue,
                aggregate2:
                  res.data.dischargeinfo.fAggregate2actualweighingvalue,
                aggregate3:
                  res.data.dischargeinfo.fAggregate3actualweighingvalue,
                aggregate4:
                  res.data.dischargeinfo.fAggregate4actualweighingvalue,
                aggregate5:
                  res.data.dischargeinfo.fAggregate5actualweighingvalue,
                aggregate6:
                  res.data.dischargeinfo.fAggregate6actualweighingvalue,
                water: res.data.dischargeinfo.fWateractualweighingvalue,
              },

              {
                name: "设定比例(%)",
                cement1: res.data.dischargeinfo.fCement1designratio,
                cement2: res.data.dischargeinfo.fCement2designratio,
                aggregate1: res.data.dischargeinfo.fAggregate1designratio,
                aggregate2: res.data.dischargeinfo.fAggregate2designratio,
                aggregate3: res.data.dischargeinfo.fAggregate3designratio,
                aggregate4: res.data.dischargeinfo.fAggregate4designratio,
                aggregate5: res.data.dischargeinfo.fAggregate5designratio,
                aggregate6: res.data.dischargeinfo.fAggregate6designratio,
                water: res.data.dischargeinfo.fWaterdesignratio,
              },
              {
                name: "实际比例(%)",
                cement1: res.data.dischargeinfo.fCement1actualratio, //水泥1
                cement2: res.data.dischargeinfo.fCement2actualratio, //水泥2
                aggregate1: res.data.dischargeinfo.fAggregate1actualratio, //骨料1
                aggregate2: res.data.dischargeinfo.fAggregate2actualratio, //骨料2
                aggregate3: res.data.dischargeinfo.fAggregate3actualratio, //骨料3
                aggregate4: res.data.dischargeinfo.fAggregate4actualratio, //骨料4
                aggregate5: res.data.dischargeinfo.fAggregate5actualratio, //骨料5
                aggregate6: res.data.dischargeinfo.fAggregate6actualratio, //骨料6
                water: res.data.dischargeinfo.fWateractualratio, //水
              },
              {
                name: "偏差(%)",
                cement1: res.data.dischargeinfo.fCement1deviatevalue, //水泥1
                cement2: res.data.dischargeinfo.fCement2deviatevalue, //水泥2
                aggregate1: res.data.dischargeinfo.fAggregate1deviatevalue, //骨料1
                aggregate2: res.data.dischargeinfo.fAggregate2deviatevalue, //骨料2
                aggregate3: res.data.dischargeinfo.fAggregate3deviatevalue, //骨料3
                aggregate4: res.data.dischargeinfo.fAggregate4deviatevalue, //骨料4
                aggregate5: res.data.dischargeinfo.fAggregate5deviatevalue, //骨料5
                aggregate6: res.data.dischargeinfo.fAggregate6deviatevalue, //骨料6
                water: res.data.dischargeinfo.fWaterdeviatevalue, //水
              },
              {
                name: "预警范围值",
                show: true,
                cement1: res.data.dischargeinfo.fCement1warninginfo, //水泥1
                cement2: res.data.dischargeinfo.fCement2warninginfo, //水泥2
                aggregate1: res.data.dischargeinfo.fAggregate1warninginfo, //骨料1
                aggregate2: res.data.dischargeinfo.fAggregate2warninginfo, //骨料2
                aggregate3: res.data.dischargeinfo.fAggregate3warninginfo, //骨料3
                aggregate4: res.data.dischargeinfo.fAggregate4warninginfo, //骨料4
                aggregate5: res.data.dischargeinfo.fAggregate5warninginfo, //骨料5
                aggregate6: res.data.dischargeinfo.fAggregate6warninginfo, //骨料5
                water: res.data.dischargeinfo.fWaterwarninginfo, //水
              },
            ];
            this.level = [
              "",
              res.data.dischargeinfo.fCement1warninglevel,
              res.data.dischargeinfo.fCement2warninglevel,
              res.data.dischargeinfo.fAggregate1warninglevel,
              res.data.dischargeinfo.fAggregate2warninglevel,
              res.data.dischargeinfo.fAggregate3warninglevel,
              res.data.dischargeinfo.fAggregate4warninglevel,
              res.data.dischargeinfo.fAggregate5warninglevel,
              res.data.dischargeinfo.fAggregate6warninglevel,
              res.data.dischargeinfo.fWaterwarninglevel,
            ];
            this.earlyWarning = [
              "",
              res.data.dischargeinfo.fCement1warninginfo,
              res.data.dischargeinfo.fCement2warninginfo,
              res.data.dischargeinfo.fAggregate1warninginfo,
              res.data.dischargeinfo.fAggregate2warninginfo,
              res.data.dischargeinfo.fAggregate3warninginfo,
              res.data.dischargeinfo.fAggregate4warninginfo,
              res.data.dischargeinfo.fAggregate5warninginfo,
              res.data.dischargeinfo.fAggregate6warninginfo,
              res.data.dischargeinfo.fWaterwarninginfo,
            ];
          } else {
            this.$message.error("详情报错", res.msg);
          }
        });
      } else {
        return this.$message.error("请先选择需要查看的数据");
      }
    },
    // 保存接口
    yj_saveForm() {
      this.handleData.fCompanyid = this.getList.fCompanyid; // 施工标段id
      if (this.checkStatus == 0) {
        //闭合申请单
        if (this.$refs.publicForm0.submitForm()) {
          this.saveForm(this.handleData);
        } else {
          console.log("error");
        }
      } else if (this.checkStatus == 1) {
        if (this.$refs.publicForm1.submitForm()) {
          this.saveForm(this.handleData);
        } else {
          console.log("error");
        }
      } else if (this.checkStatus == 2) {
        if (this.$refs.publicForm2.submitForm()) {
          this.saveForm(this.handleData);
        } else {
          console.log("error");
        }
      }
    },
    // 保存接口
    saveForm(data) {
      console.log("保存参数", data);
      addWaterClosedForm(data)
        .then((res) => {
          if (res.errcode == 0) {
            this.yj_searchForm(this.getList);
            this.$message.success("新增成功");
          } else {
            this.$message.error(res.msg);
            console.log("接口报错");
          }
        })
        .catch((error) => {
          console.log("拌合站设置-新增）", error);
        });
    },

    delteFile(file) {
      for (let index = 0; index < this.fSourcefileList.length; index++) {
        if (file.uid == this.fSourcefileList[index].uid) {
          if (this.fSourcefileList[index].atta == undefined) {
            this.handleData.recordfiles.push({
              fId: this.fSourcefileList[index].fId,
            });
          } else {
            this.handleData.recordfiles.push({
              fId: this.fSourcefileList[index].atta.fId,
            });
          }
          this.fSourcefileList.splice(index, 1);
        }
      }
    },
    // 折叠面板
    changeCollapse(e) {
      console.log(this.activeNames, e);
    },

    selectionChange() {},
    // 排序方法
    sortChange() {},
  },
};
</script>

<style scoped lang="less">
.TensionRealTime {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.printTables {
  background: #fff;
  display: flex;
  justify-content: end;
  padding: 5px;
  margin-top: 10px;
}

.dialogBody {
  padding: 3px 20px;
  height: 80%;
  // overflow-y: auto;
  display: flex;
  flex-direction: column;

  .jpbox {
    height: 100%;
  }

  .dialogBody {
    position: relative;
  }

  .tab {
    display: flex;
    font-size: 14px;
    height: 30px;
    line-height: 30px;
    box-sizing: border-box;
    border-bottom: 2px solid #e4e7ed;
    padding: 0 0.16rem;

    .btn {
      margin-top: 4px;
      margin-right: 16px;
      width: 102px;
      height: 24px;
      display: flex;
      justify-content: center;
      align-items: center;
      border-top-right-radius: 4px;
      border-top-left-radius: 4px;
    }
  }

  .charts {
    // height: calc(100% - 30px);
    height: 620px;
  }
}

.baseTitle {
  /* border: 1px solid #0c204d; */
  border-bottom: 1px solid #0c204d;

  height: 30px;
  line-height: 30px;
  position: relative;
  padding-left: 15px;
}

.baseTitle::after {
  display: block;
  content: "";
  height: 30px;
  width: 5px;
  position: absolute;
  left: 0;
  top: 0;
  background: #0c204d;
}

.materialClass /deep/.el-table tr:nth-child(5) {
  display: none;
}

.jipeiBox {
  display: flex;
  flex: 1;

  .left {
    width: 60%;
    margin-right: 15px;
    display: flex;
    flex-direction: column;

    .errorMonitoring {
      flex: 1;
    }
  }

  .right {
    width: 40%;

    display: flex;
    flex-direction: column;

    .errorMonitoring {
      flex: 1;
      box-sizing: border-box;
      display: flex;
      justify-content: center;
      align-items: center;

      .tableWaring {
        width: 90%;
        height: 85%;
        margin: 15px;
        box-sizing: border-box;

        display: flex;
        flex-direction: column;
        align-content: space-around;
        border: 1px solid #ebeef5;
        border-bottom: none;

        .line {
          flex: 1;
          display: flex;
          line-height: 20px;
          // height: 25px;
          // line-height: 25px;
          border-bottom: 1px solid #ebeef5;

          .tableName {
            width: 40%;
            display: flex;
            justify-content: center;
            align-items: center;
            border-right: 1px solid #ebeef5;
          }

          .tableData {
            width: 55%;
            padding-left: 8px;
          }
        }

        .line:nth-child(2n) {
          background: #dbe7f5;
          color: #4f6375;
        }
      }
    }
  }
}
</style>
